package com.monliao.thread.util;

import java.util.Date;

import org.htmlparser.Parser;
import org.htmlparser.filters.HasAttributeFilter;
import org.htmlparser.nodes.TagNode;
import org.htmlparser.util.NodeList;

public class runThread extends Thread {
	
	
			private int startPage;
			private int endPage;
	
	
				
				public runThread(int startPage, int endPage) {
				super();
				this.startPage = startPage;
				this.endPage = endPage;
			}



				public void run(){
					
					try {
						
						
						for (int i = startPage; i <endPage; i++) {
							
							Parser parser=new Parser("http://mm.10086.cn/android/software/qbrj?p="+i);
							parser.setEncoding("UTF-8");
							HasAttributeFilter attributeFilter=new HasAttributeFilter("class","autoword");
							NodeList nodeList = parser.parse(attributeFilter);
							
							for (int j = 0; j < nodeList.size(); j++) {
								String href = ((TagNode) nodeList.elementAt(j)).getAttribute("href");
								System.out.println(href);
								
								
							}
							
						}
						
						
						
						
						
					} catch (Exception e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}



			
}
